using System.Runtime.InteropServices;
using FluentTests.Framework.Verbs;

namespace FluentTests.Framework.VerbExtensions
{
    public static class VerbInt64Extensions
    {
        public static void GreaterThan(this Is<long> verb, long compareValue)
        {
            var assertion = verb.EnsuredWrapperObject.AssertionProvider;
            var actualValue = verb.EnsuredWrapperObject.ActualValue;
            NumberAssertion.GreaterThan(actualValue,compareValue,verb.Negated,assertion);
        }

        public static void LessThan(this Is<long> verb, long compareValue)
        {
            var assertion = verb.EnsuredWrapperObject.AssertionProvider;
            var actualValue = verb.EnsuredWrapperObject.ActualValue;
            NumberAssertion.LessThan(actualValue, compareValue, verb.Negated, assertion);
        }

        public static void EqualTo(this Is<long> verb, long compareValue,[Optional, DefaultParameterValue(null)] string message)
        {
            VerbAssert<long>.Assert(
                verb,
                a => a != compareValue,
                message ?? "Actual value is {not} equal to expected value");
        }


        public static void Zero(this Is<long> verb)
        {
            var assertion = verb.EnsuredWrapperObject.AssertionProvider;
            var actualValue = verb.EnsuredWrapperObject.ActualValue;
            NumberAssertion.Zero(actualValue, verb.Negated, assertion);
        }
    }

    public static class VerbStringExtensions
    {
        public static void MoreThanZeroCharacters(this Has<string> verb)
        {
            var assertion = verb.EnsuredWrapperObject.AssertionProvider;
            var actualValue = verb.EnsuredWrapperObject.ActualValue;
            VerbAssert<string>.Assert(verb,a=>a.Length==0,"The length of the string is {not} more than zero");

        }
    }
}